modify format access to waypts via global list. (#478)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Mon, 27 Jan 2020 19:22:23 +0000 (12:22 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Jan 2020 19:22:23 +0000 (12:22 -0700)
commite6c2f6c26d5dfea5896e9d0e8b9052d60b7a7fde
treebf0a8b8485826af0819dbc6b51055c4df89b114e
parent340fffd6baf2bbd1661f16c84092870afd7e19df
modify format access to waypts via global list. (#478)

As a rule writers should not modify waypoints on the global list.
One way this can happen is if the writer uses the global waypoint
list, global_waypoint_list.  Via the list pointers to non-const
Waypoints can be accessed.  The three writers that use the
global_waypoint_list all did not modify any waypoints, but it was not obvious.
This PR makes it obvious by getting const Waypoint pointers from the list.
This required some const correctness corrections in these writers.

As a rule readers should not modify waypoints they didn't add to the
global list.
One way this can happen is if the reader uses the global waypoint list.
One reader was inapproprieately modifying waypoints on the global list.
While this is OK for waypoints it added, it is not OK for any waypoints
that were added by other readers.  This PR fixes a bug where the
netsumbler reader, intending to modify waypoints it added to the list,
actually modified all waypoints on the list.
garmin.cc
lowranceusr.cc
netstumbler.cc
tomtom.cc